﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Delphi.Mimir.Data.Entities.Raw.Mappings {
    class RawIncomeStatementMap : EntityTypeConfiguration<RawIncomeStatement> {
        public RawIncomeStatementMap() {
            /******************************************************************
            /* Table
            /*****************************************************************/
            ToTable("raw.eod_income_statements");

            /******************************************************************
            /* Primary Key
            /*****************************************************************/
            HasKey(a => a.sis_id);

            /******************************************************************
            /* Index
            /*****************************************************************/
            // None

            /******************************************************************
            /* Relationships
            /*****************************************************************/
            // None

            /******************************************************************
            /* Properties
            /*****************************************************************/
            Property(a => a.sis_id)
                .IsRequired()
                .HasColumnName("sis_id");

            Property(a => a.sis_sym_cd)
                .IsRequired()
                .IsUnicode(false)
                .HasMaxLength(25)
                .HasColumnName("sis_sym_cd");

            Property(a => a.sis_exc_cd)
                .IsRequired()
                .IsUnicode(false)
                .HasMaxLength(25)
                .HasColumnName("sis_exc_cd");

            Property(a => a.sis_period)
                .IsRequired()
                .IsUnicode(false)
                .HasMaxLength(25)
                .HasColumnName("sis_period");

            Property(a => a.sis_dt)
                .IsRequired()
                .HasColumnName("sis_dt");

            Property(a => a.sis_tot_revenue)
                .IsOptional()
                .HasColumnName("sis_tot_revenue");

            Property(a => a.sis_cogs)
                .IsOptional()
                .HasColumnName("sis_cogs");

            Property(a => a.sis_gross_profit)
                .IsOptional()
                .HasColumnName("sis_gross_profit");

            Property(a => a.sis_rnd)
                .IsOptional()
                .HasColumnName("sis_rnd");

            Property(a => a.sis_sga)
                .IsOptional()
                .HasColumnName("sis_sga");

            Property(a => a.sis_non_rec_exp)
                .IsOptional()
                .HasColumnName("sis_non_rec_exp");

            Property(a => a.sis_other_exp)
                .IsOptional()
                .HasColumnName("sis_other_exp");

            Property(a => a.sis_tot_opex)
                .IsOptional()
                .HasColumnName("sis_tot_opex");

            Property(a => a.sis_op_income)
                .IsOptional()
                .HasColumnName("sis_op_income");

            Property(a => a.sis_tot_other_income)
                .IsOptional()
                .HasColumnName("sis_tot_other_income");

            Property(a => a.sis_ebit)
                .IsOptional()
                .HasColumnName("sis_ebit");

            Property(a => a.sis_interest_expense)
                .IsOptional()
                .HasColumnName("sis_interest_expense");

            Property(a => a.sis_ebt)
                .IsOptional()
                .HasColumnName("sis_ebt");

            Property(a => a.sis_income_tax_expense)
                .IsOptional()
                .HasColumnName("sis_income_tax_expense");

            Property(a => a.sis_minority_interest)
                .IsOptional()
                .HasColumnName("sis_minority_interest");

            Property(a => a.sis_ni_continuing_ops)
                .IsOptional()
                .HasColumnName("sis_ni_continuing_ops");

            Property(a => a.sis_discnt_ops)
                .IsOptional()
                .HasColumnName("sis_discnt_ops");

            Property(a => a.sis_extraordinary_items)
                .IsOptional()
                .HasColumnName("sis_extraordinary_items");

            Property(a => a.sis_accounting_changes)
                .IsOptional()
                .HasColumnName("sis_accounting_changes");

            Property(a => a.sis_other_items)
                .IsOptional()
                .HasColumnName("sis_other_items");

            Property(a => a.sis_ni)
                .IsOptional()
                .HasColumnName("sis_ni");

            Property(a => a.sis_prfrd_stock_adjust)
                .IsOptional()
                .HasColumnName("sis_prfrd_stock_adjust");

            Property(a => a.sis_ni_common)
                .IsOptional()
                .HasColumnName("sis_ni_common");
        }
    }
}
